%The mapple!!!
clear;
W=[ 0.49 0.01 0 0.62 25 -2; 
    0.27 0.52 -0.40 0.36 0 56;
    0.18 -0.73 0.50 0.26 88 8;
    0.04 -0.01 0.50 0 52 32];
P=[0.25 0.25 0.25 0.25];
A0=[0 0];


%with DIA
Mapple=MYDIA_R2(A0,W,4,8);
X=Mapple(:,1);
Y=Mapple(:,2);
plot(X, Y , 'b.' , 'MarkerSize' , 2);

%with RIA
P=[0.3 0.34 0.34 0.02];
MYRIA_R2(A0,W,P,4,200000);





%The Sierpinski!!!
clear;
W=[ 0.5 0.0 0.0 0.5 0.0 0; 
    0.5 0.0 0.0 0.5 50 0;
    0.5 0.0 0.0 0.5 0.0 50];
A0=[1 1];

%with DIA
Sierpinski=MYDIA_R2(A0,W,3,10);
X=Sierpinski(:,1);
Y=Sierpinski(:,2);
plot(X, Y , 'b.' , 'MarkerSize' , 2);














%The Cantor
clear;
W=[ 0.3333 0 0 0 0 0 ; 
    0.3333 0 0 0 0.3333 0;];

A0=[0 0];

%with DIA
Cantor=MYDIA_R2(A0,W,2,10);
X=Cantor(:,1);
Y=Cantor(:,2);
plot(X, Y , 'b.' , 'MarkerSize' , 4);






%a fern
clear;
W=[ 0.00 0.00 0.00 0.16 0.00 0.00; 
    0.85 0.04 -0.04 0.85 0 1.6;
    0.2 -0.26 0.23 0.22 0 1.6;
    -0.15 0.28 0.26 0.24 0 0.44];
A0=[0 0];

%with DIA
fern=MYDIA_R2(A0,W,4,9);
X=fern(:,1);
Y=fern(:,2);
plot(X, Y , 'b.' , 'MarkerSize' , 2);

%with RIA
P=[0.01 0.69 0.15 0.15];
MYRIA_R2(A0,W,P,4,100000);





%Another fern
clear;
W=[ -0.02 0.39 -0.31 0.30 96 108; 
    0.68 0.17 -0.17 0.68 73 11;
    0.05 -0.80 -0.22 -0.19 286 131;
    0.02 -0.36 0.00 0.38 160 97];
A0=[0 0];
P=[0.3 0.34 0.34 0.02];

%with DIA
fern2=MYDIA_R2(A0,W,4,6);
X=fern2(:,1);
Y=fern2(:,2);
plot(X, Y , 'b.' , 'MarkerSize' , 2);

%with RIA
P=[0.3 0.34 0.34 0.02];
MYRIA_R2(A0,W,P,4,200000);















%RIA example of RIFS
clear;
W=[ 0.5 0.0 0.0 0.5 0.0 0; 
    0.5 0.0 0.0 0.5 50 0;
    0.5 0.0 0.0 0.5 0.0 50;
    0.5 0.0 0.0 0.5 50 50];
A0=[1 1];
P=1/10* [ 0 2 4 9;
          1 2 4 8;
          4 2 1 8;
          4 2 1 8]

MYRRIA_R2(A0,W,P,4,250000,1);





%The mapple!!!
clear;
W=[ 0.49 0.01 0 0.62 25 -2; 
    0.27 0.52 -0.40 0.36 0 56;
    0.18 -0.73 0.50 0.26 88 8;
    0.04 -0.01 0.50 0 52 32];
A0=[1 1];
P=1/2* [ 1 1 0 0;
         1 1 0 0;
         0 0 1 0;
         0 0 1 1]

MYRRIA_R2(A0,W,P,4,50000,3);
